package org.richin.file.util;

import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.nio.CharBuffer;

import org.richin.io.util.IOUtils;
import org.richin.lang.util.StringUtils;

public class SearchFile {
	public static void search(String path,String search){
		BufferedReader reader=IOUtils.getBufferedReader(new File(path));
		CharBuffer target=CharBuffer.allocate(1024);
		String line;
		
		try {
			
			while((line=reader.readLine())!=null){
				if(StringUtils.contains(line, search)){
					System.out.println(path);
					break;
				}
			}
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	public static void main(String[] args) {
		long st=System.currentTimeMillis();
		String path="E:/eclipsej/terter/terter/memo_backup/umemo/umemo/WebRoot/usermanagement/userDetailEdit.jsp";
		search(path, "href");
		System.out.println(System.currentTimeMillis()-st);
	}
}
